﻿using UnityEngine;
using System.Collections;

public class ShotExplosion : MonoBehaviour {
	
	public GameObject ExplosionPrefab; 
	public float maxLiveTime = 5;
	float liveTime = 0;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		liveTime += Time.deltaTime;
//		Debug.Log(liveTime);
		if(liveTime > maxLiveTime){
			Kill();
		}
	}


	public void Kill(){
		Instantiate(ExplosionPrefab, transform.position, Quaternion.identity);
		Destroy(gameObject);
	}
}
